package azouz.interview.interview;

import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.Hashtable;
import java.util.SortedSet;

/**
 * Hello world!
 *
 */
final public class App {

    static int i;

    public static void main(String[] args) throws Exception {
        A a = new B();
        B b = new B();
        b.test(a);
        a.test(a);

        Class c = Class.forName("asdasdadsasd");
        Object ss = c.newInstance();

        Class[] paClasses = new Class[1];
        paClasses[0] = String.class;
        
        Method m=c.getDeclaredMethod("hhh", paClasses);
        m.invoke(ss, paClasses);
    }
}

class A {

    public void test(A b) throws Exception {
        System.out.println("A");
    }
}

class B extends A {

    public void test(A b) {
        System.out.println("B");
    }

}
